<template>
	<m-layout2 title="个人资料" gap="24">
		<m-block gap="0 24">
			<m-cell @click="jump(1,userInfo.mobile)" title="手机号" :rightText="userInfo.mobile || '未设置'"></m-cell>
			<m-cell @click="jump(2,userInfo.email)" title="邮箱" :rightText="userInfo.email || '未设置'"></m-cell>
			<m-cell @click="Jump('/pages/login/retrieved/retrieved?title=修改登录密码')" title="登录密码" rightText="修改"></m-cell>
			<m-cell @click="Jump('/pages/wallet/bankList/bankList')" title="我的银行卡" rightText=""></m-cell>
			<m-cell border="0" @click="Jump('/pages/mine/setAccount/security/editorPay/editorPay')" title="支付密码" rightText="修改">
			</m-cell>
			<!-- <m-cell title="指纹支付" :rightIconShow="false">
				<view slot="right">
					<switch :checked="defaule" color="#FA2B47" @change="switchChange" />
				</view>
			</m-cell> -->
		</m-block>
	</m-layout2>
</template>

<script>
	import { getUserInfo } from '@/utils/auth.js'
	import { mapState } from 'vuex'
	export default {
		data() {
			return {
				defaule: true,
				editorTitle: "绑定手机号"
			};
		},
		computed: {
			...mapState({
				userInfo: state => state.user.userinfo
			})
		},
		onShow() {
			console.log(this.userInfo);
		},
		methods: {
			switchChange(e) {
				console.log(e.detail);
			},
			jump(type, val) {
				if (type === 1) {
					if (val) {
						this.editorTitle = "修改手机号"
					} else {
						this.editorTitle = "绑定手机号"
					}
				} else if (type === 2) {
					if (val) {
						this.editorTitle = "修改邮箱"
					} else {
						this.editorTitle = "绑定邮箱"
					}
				}
				this.Jump({
					url: '/pages/mine/setAccount/security/editorAccount/editorAccount',
					params: {
						type: type,
						title: this.editorTitle,
						val: val
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
